package top.lyc829.iot_android.adapter;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.xuexiang.xui.widget.imageview.RadiusImageView;

import org.jetbrains.annotations.NotNull;

import top.lyc829.iot_android.R;
import top.lyc829.iot_android.entity.User;
import top.lyc829.iot_android.util.Utils;

/**
 * @Author lyc
 * @create 2021-06-19 20:03
 */
public class FriendAdapter extends BaseQuickAdapter<User, BaseViewHolder> {
    public FriendAdapter() {
        super(R.layout.user_item);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, User user) {
        baseViewHolder.setText(R.id.tv_user_name, user.getName());
        baseViewHolder.setText(R.id.tv_phone, user.getPhoneNum());
        RadiusImageView imageView = baseViewHolder.getView(R.id.user_avatar);
        Glide.with(imageView)
                .load(user.getAvatarUrl())
                .into(imageView);
    }
}
